#include "flash_blob.h"

static const uint32_t flash_code[] =
{
    0XE00ABE00,0X062D780D,0X24084068,0XD3000040,0X1E644058,0X1C49D1FA,0X2A001E52,0X4770D1F2,
    0X4603B510,0X04C00CD8,0X444C4C47,0X20006020,0X60204C46,0X60604846,0X60604846,0X69C04620,
    0X0004F000,0XF245B940,0X4C435055,0X20066020,0XF6406060,0X60A070FF,0XBD102000,0X483B4601,
    0XF0406900,0X4A390080,0X20006110,0X48374770,0XF0406900,0X49350004,0X46086108,0XF0406900,
    0X61080040,0XF64AE003,0X493320AA,0X482F6008,0XF00068C0,0X28000001,0X482CD1F5,0XF0206900,
    0X492A0004,0X20006108,0X46014770,0X69004827,0X0002F040,0X61104A25,0X61414610,0XF0406900,
    0X61100040,0XF64AE003,0X4A2320AA,0X481F6010,0XF00068C0,0X28000001,0X481CD1F5,0XF0206900,
    0X4A1A0002,0X20006110,0XB5104770,0X1C484603,0X0101F020,0X4815E023,0XF0406900,0X4C130001,
    0X88106120,0XBF008018,0X68C04810,0X0001F000,0XD1F92800,0X6900480D,0X0001F020,0X61204C0B,
    0X68C04620,0X0014F000,0X4620B130,0XF04068C0,0X60E00014,0XBD102001,0X1C921C9B,0X29001E89,
    0X2000D1D9,0X0000E7F7,0X00000004,0X40022000,0X45670123,0XCDEF89AB,0X40003000,0X00000000,
    0X00000000,
};

const program_target_t flash_algo_HK32F1XX =
{
    0X20000021,  // Init
    0X2000005D,  // UnInit
    0X2000006F,  // EraseChip
    0X200000AB,  // EraseSector
    0X200000EB,  // ProgramPage

    // BKPT : start of blob + 1
    // RSB  : address to access global/static data
    // RSP  : stack pointer
    {
        0X20000001,
        0X20000C00,
        0X20001000,
    },

    0x20000400,                      // mem buffer location
    0x20000000,                      // location to write prog_blob in target RAM
    sizeof(flash_code),              // prog_blob size
    flash_code,                      // address of prog_blob
    0x00000400,                      // ram_to_flash_bytes_to_be_written
};
